class MediaLocatorsController < ApplicationController
  def index
    @media_locators = MediaLocator.all
  end

  def show
    @media_locator = MediaLocator.find(params[:id])
  end

  def new
    @media_locator = MediaLocator.new
  end

  def create
    @media_locator = MediaLocator.new(params[:media_locator])
    if @media_locator.save
      redirect_to @media_locator, :notice => "Successfully created media locator."
    else
      render :action => 'new'
    end
  end

  def edit
    @media_locator = MediaLocator.find(params[:id])
  end

  def update
    @media_locator = MediaLocator.find(params[:id])
    if @media_locator.update_attributes(params[:media_locator])
      redirect_to @media_locator, :notice  => "Successfully updated media locator."
    else
      render :action => 'edit'
    end
  end

  def destroy
    @media_locator = MediaLocator.find(params[:id])
    @media_locator.destroy
    redirect_to media_locators_url, :notice => "Successfully destroyed media locator."
  end
end
